package edu.szcu.vitaguard.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/*****
 * *这是一个控制器
 */
//@Controller
    @RestController //相当于给下面的每个方法上面都添加了@ResponseBody
public class IndexController {

    @RequestMapping(value = "/hello",method = RequestMethod.GET)
//    @ResponseBody
    public String hello() {
        System.out.println("有请求进来访问我了");
        //
        return "我是来自于服务端控制器返回的数据";
    }

    @GetMapping("/arr")
//    @ResponseBody
    public String[] array(int count){

        System.out.println("请求来到了array方法...count"+count);
        //
        return new String[]{"Spring","Autumn","Summer","Winter"};
    }
}
